/**
 * Created by ltx on 2017/5/24.
 */

jQuery(document).ready(function($){
    $('.us').click(function(){$('html,body').animate({scrollTop:$('#st-panel-1').offset().top}, 800);});
    $('.production').click(function(){$('html,body').animate({scrollTop:$('#st-panel-2').offset().top}, 500);});
    $('.highlights').click(function(){$('html,body').animate({scrollTop:$('#st-panel-3').offset().top}, 800);});

    var bg=$(".containt-us");

    var coop=$(".coop-btn");
    var pat=$(".path-btn");
    var glo=$(".gloey-btn");

    var coop2=$(".cooperat");
    var pat2=$(".path");
    var glo2=$(".gloey");

    var yearcontr97=$(".year-contr97");
    var yearcontr28=$(".year-contr28");

    var path1=$(".path-1");
    var path2=$(".path-2");

    var gloey1=$(".gloey-1");
    var gloey2=$(".gloey-2");
    var gloey3=$(".gloey-3");

    var yearcontr36=$(".year-contr36");
    var yearcontr82=$(".year-contr82");
    var yearcontr37=$(".year-contr37");

    var movie1=$("#movies");
    var shortfilm=$("#short-film");
    var tvplay=$("#tv-play");
    var adver=$("#advertise");

    var movies1=$(".movies-1");
    var movies2=$(".movies-2");
    var movies3=$(".movies-3");
    var movies4=$(".movies-4");

    var addshortfilm1=$(".addshortfilm");
    var turnout1=$(".turnout");

    addshortfilm1.on("click",function () {
            turnout1.toggle();
    })

    adver.on("click",function () {
        movies1.hide(0);
        movies2.hide(0);
        movies3.hide(0);
        movies4.show(0);
    });

    movie1.on("click",function () {
        movies1.show(0);
        movies2.hide(0);
        movies3.hide(0);
        movies4.hide(0);
    });

    shortfilm.on("click",function () {
        movies1.hide(0);
        movies2.show(0);
        movies3.hide(0);
        movies4.hide(0);
    });

    tvplay.on("click",function () {
        movies1.hide(0);
        movies2.hide(0);
        movies3.show(0);
        movies4.hide(0);
    });

    yearcontr36.on("click",function () {
        gloey1.show(500);
        gloey2.hide(500);
        gloey3.hide(500);
    });

    yearcontr82.on("click",function () {
        gloey1.hide(500);
        gloey2.show(500);
        gloey3.hide(500);
    });

    yearcontr37.on("click",function () {
        gloey1.hide(500);
        gloey2.hide(500);
        gloey3.show(500);
    });

    coop.on("click",function () {
        coop2.show(500);
        pat2.hide(500);
        glo2.hide(500);
        coop.css({"background-color":"#7fbfed"});
        pat.css({"background-color":"#fcca57"});
        glo.css({"background-color":"#fcca57"});
        bg.css("background","url(img/companey-bg.png)");
    });

    pat.on("click",function () {
        coop2.hide(500);
        pat2.show(500);
        glo2.hide(500);
        coop.css({"background-color":"#fcca57"});
        pat.css({"background-color":"#7fbfed"});
        glo.css({"background-color":"#fcca57"});
        bg.css("background","url(img/guiji.jpg)");
    });

    glo.on("click",function () {
        coop2.hide(500);
        pat2.hide(500);
        glo2.show(500);
        coop.css({"background-color":"#fcca57"});
        pat.css({"background-color":"#fcca57"});
        glo.css({"background-color":"#7fbfed"});
        bg.css({"background":"url(img/rongyu-bg.png)"});
    });

    yearcontr97.on("click",function () {
        path1.show(500);
        path2.hide(500);
    });
    yearcontr28.on("click",function () {
        path1.hide(500);
        path2.show(500);
    });

    $('.carousel').carousel({
        interval: 999999999
    });
});

